/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_Studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#include "线操作计算.h"



S_连接线相交计算::S_连接线相交计算(S_设备环境& ctx) {
	
	std::vector<S_着色器创建参数> 参数配置;
	参数配置 = {
		{0, E_着色阶段::e_计算着色, E_板载缓存类型::e_VBO},
		{1, E_着色阶段::e_计算着色, E_板载缓存类型::e_SSBO},
		{2, E_着色阶段::e_计算着色, E_板载缓存类型::e_SSBOd},

		{3, E_着色阶段::e_计算着色, E_板载缓存类型::e_UBO},

		{4, E_着色阶段::e_计算着色, E_板载缓存类型::e_SSBO},
	};

	m_Gpu = f_gpu_create并行计算实例(ctx, "D:/U/Project/engine/材质/着色/2D/UI连接线相交检测.spv", 参数配置);
	m_Gpu->m_Shader->f_alloc参数设置(&(m_Gpu->m_GPU参数set));
}

void S_连接线相交计算::f_updateGPU参数(S_板载缓存* 属性, S_板载缓存* 连接线, S_板载缓存* 连接是否启用, S_板载缓存* 剪刀线, S_板载缓存* 交点) {
	m_参数元素数量 = 5;
	m_参数元素 = (S_板载缓存**)calloc(m_参数元素数量, sizeof(S_板载缓存*));
	

	m_参数元素[0] = 剪刀线;
	m_参数元素[1] = 连接线;
	m_参数元素[2] = 交点;
	m_参数元素[3] = 属性;
	m_参数元素[4] = 连接是否启用;


	//f_setGPU参数布局(m_Shader, m_并行计算GPU参数set, { m_参数元素, 0, m_参数元素数量, 0 });
}






